package com.feel.modules.auth.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.feel.common.utils.R;
import com.feel.modules.app.dto.UserCurrentDto;
import com.feel.modules.app.entity.UserEntity;
import com.feel.modules.app.vo.RegisterVo;
import org.springframework.http.HttpHeaders;

import javax.servlet.http.HttpServletRequest;

public interface UserService extends IService<UserEntity> {

    R createUserByPhone(RegisterVo registerVo, HttpHeaders httpHeaders);

    /**
     * 根据用户名密码判断是否校验通过
     *
     * @param username
     * @param password
     * @return
     */
    UserEntity checkUser(String username, String password);

    /***
     * 根据用户名查询用户信息
     * @param username
     * @return
     */
    UserEntity loadUserByUsername(String username);

    /**
     * 根据用户ID修改密码
     *
     * @param userId
     * @param oldPassword
     * @param newPassword
     * @return
     */
    boolean restPassword(String userId, String oldPassword, String newPassword);

    /**
     * 根据userName修改密码
     *
     * @param userName
     * @param oldPassword
     * @param newPassword
     * @return
     */
    boolean restByuserName(String userName, String oldPassword, String newPassword);

//    UserCurrentDto rebuildCurrent(Long userId);


    //    WxMaJscode2SessionResult getSessionInfo(String code, String appid);
    String getOpenid(String code, String appid);


    /***
     * 根据token请求查询是否已填入手机号
     * @param request
     * @return
     */
    boolean confrimed(HttpServletRequest request);

    UserEntity checkUserByVerificationCode(String username, String password);

//    Object comfrimedWithPhone(ComfrimWechatUserVo comfrimWechatUserVo, HttpHeaders httpHeaders);

    /***
     * 根据sessionKey获取session
     * @param appid
     * @return
     */
//    WxMaPhoneNumberInfo getPhoneNumberInfo(String sessionKey, String appid, String encryptedData, String iv);

//    String createQrcode(UserManageVo userManageVo);


}
